package com.study.practice.utils.test;

import java.util.ArrayList;

public class ScalarReplace {
    private class User {
        public String name;
        public int age;
    }

    private void alloc() {
        User user = new User();
        user.age = 5;
        user.name = "www.atguigu.com";
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        ScalarReplace scalarReplace = new ScalarReplace();
        for (int i = 0; i < 10000000; i++) {
            scalarReplace.alloc();
        }
        long end = System.currentTimeMillis();
        System.out.println("cost ms:" + (end - start));

        ArrayList<String> strings = new ArrayList<>();
        String s = new String();
        String s1 = new String();
    }
}
